/**
 * Created by Baggio on 2018-10-18.
 */
$(function () {
    $("#excelIn").click(function () {
        $("#searchForm").ajaxSubmit({
            type: "POST",
            url: '/watchEnroll/excelIn.html',
            data: $('#searchForm').serialize(),
            dataType:"json",
            error: function (request) {

                alert("Connection error");
            },
            beforeSend: function () {
                console.log("begin...............");
                $(".loading").show();
            },
            success: function (data) {
                console.log(data);
                if (data.code != 0) {
                    layer.msg('成功!', {icon: 6, time: 1000}, function () {
                        // console.log(data);
                        // window.parent.location.reload();
                        // var index = parent.layer.getFrameIndex(window.name);
                        // parent.layer.close(index);
                        window.location.reload();//刷新当前页面
                    })
                }
            },
            complete: function (XMLHttpRequest, textStatus) {
                // alert('远程调用成功，状态文本值：'+textStatus);
                console.log("end...............");
                $(".loading").hide();
            },
        });
    }) ;
    $("#excelOut").click(function () {
        var pro= $('#searchForm').serialize();
        location.href="/watchEnroll/excelOut.html?pro"+pro;
    })
});
function modifyApplyStatus(tid, orderId, status) {
    var postData = {tid: tid, orderId: orderId, status: status};
    $.ajax({
        type: 'POST',
        data: postData,
        url: '/watchEnroll/modifyApplyStatus.html',
        dataType: 'json',
        success: function (data) {
            //    var data=JSON.parse(res)
            if (data.code != 1) {
                alert(data.msg);
                return;
            }
            console.log(data);
            alert("修改成功！");


        }
    })

}